home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / datamaster_lib.lha / Datamaster / Developer / Include / C / libraries / datamaster.h
C/C++ Source or Header  |  1997-05-01  |  7KB  |  216 lines

  1. #ifndef LIBRARIES_DATAMASTER_H
  2. #define LIBRARIES_DATAMASTER_H
  3.  
  4. /*
  5. ** $Filename: libraries/datamaster.h $
  6. ** $Release: 2.0 $
  7. ** $Revision: 2.0 $
  8. **
  9. ** datamaster.library definitions
  10. **
  11. ** (C) Copyright 1995-1997 Alexis Nasr, Dirk Stöcker
  12. ** All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_LIBRARIES_H
  16. #include <exec/libraries.h>
  17. #endif
  18. #ifndef UTILITY_TAGITEM_H
  19. #include <utility/tagitem.h>
  20. #endif
  21.  
  22. #define DATAMASTERNAME  "datamaster.library"
  23.  
  24. /************************************************************************
  25. *                                    *
  26. * Headers of recognizers                        *
  27. *                                    *
  28. * Recognizer files have a special ID in it's body. Set one of the    *
  29. * following defines as the only one in it's own C source file and link    *
  30. * the resulting object files as first to final file.            *
  31. *                                    *
  32. ************************************************************************/
  33.  
  34. #define RECOHEADER    {0x70, 0xFF, 0x4E, 0x75, \
  35.               0x44, 0x41, 0x54, 0x41, 0x52, 0x45, 0x43, 0x4F}
  36. #define RECOHEADER2    {0x44, 0x41, 0x54, 0x41, 0x52, 0x45, 0x43, 0x4F}
  37.  
  38. /************************************************************************
  39. *                                    *
  40. * Library base structure                        *
  41. *                                    *
  42. ************************************************************************/
  43.  
  44. struct DatamasterBase
  45. {
  46.   struct Library    dmb_LibNode;
  47.   LONG    dmb_SegList;
  48.  
  49.   LONG    dmb_RecoAdr;    /* (internal) adr of array of recognizer segments. */
  50.   WORD    dmb_RecoNb;     /* number of  recognizers */
  51.   WORD    dmb_Flags;      /* see below */
  52.   LONG    dmb_LockNest;   /* count of LockCbases.Can only modify prefs if it is ZERO...means no user NOW. */
  53.  
  54.   LONG    dmb_DosBase;
  55.   LONG    dmb_UtilBase;
  56.   LONG    dmb_ReqBase;    /* may be ZERO... */
  57.   LONG    dmb_ResBase2;
  58.   LONG    dmb_ResBase3;
  59. };
  60.  
  61. /************************************************************************
  62. *                                    *
  63. * Flags for dmb_Flags                            *
  64. *                                    *
  65. ************************************************************************/
  66.  
  67. #define DMFLAGF_PrefsNow    (1<<0)  /* prefs are changing NOW!! please wait!!! */
  68.  
  69. /************************************************************************
  70. *                                    *
  71. * Tags for external Recognizer                        *
  72. *                                    *
  73. * Tags marked with '*' ***MUST*** be present!                *
  74. *                                    *
  75. ************************************************************************/
  76.  
  77. #define DMR_TagBase    (TAG_USER+0x444D) /* DataMaster Recognizer */
  78.  
  79. #define DMR_Check       (DMR_TagBase+ 0) /* pointer to checkroutine */
  80. #define DMR_Flags       (DMR_TagBase+ 1) /* * see defs */
  81. #define DMR_Name       (DMR_TagBase+ 2) /* * THAT one is used,*NOT* filename,so don't change it in new versions of recognizer :) */
  82. #define DMR_Descr       (DMR_TagBase+ 3) /* $VER-like description (60 chars string max) */
  83. #define DMR_Version       (DMR_TagBase+ 4) /* recoversion: Ver<<16+Rev (high W=ver/low W=rev) */
  84. #define DMR_DMVersion       (DMR_TagBase+ 5) /* needed version of library */
  85. #define DMR_Pattern       (DMR_TagBase+ 6)
  86. #define DMR_Pri           (DMR_TagBase+ 7) /* PRI_xxx predefined values */
  87. #define DMR_RecoNumber       (DMR_TagBase+ 8) /* Obsolete
  88. #define DMR_InitRoutine       (DMR_TagBase+ 9) /* optional init routine (libs needed etc) */
  89. #define DMR_ExitRoutine       (DMR_TagBase+10) /* optional exit routine (libs needed etc) */
  90.  
  91. /* additions in version 2.0 */
  92.  
  93. #define DMR_HookName           (DMR_TagBase+11) 
  94. #define    DMR_Class           (DMR_TagBase+12)
  95. #define DMR_SubTypesTable    (DMR_TagBase+13)
  96. #define    DMR_CheckRoutineHook    (DMR_TagBase+14)
  97.  
  98.  
  99. /************************************************************************
  100. *                                    *
  101. * Flag bits                                *
  102. *                                    *
  103. * These are used for DMR_Flags tag and for TestFile/TestData Mode       *
  104. *                                    *
  105. ************************************************************************/
  106.  
  107. #define RECOB_Internal        0  /* won't be Unloadseg'd ;-) */
  108. #define RECOB_CheckPatt        1  /* means the PatternTag valid */
  109. #define RECOB_CheckData        2  /* means the CheckTag valid */
  110. #define RECOB_XPKLoad        3  /* used for TestFile */
  111. #define RECOB_Disabled        4  /* NOT USED YET */
  112. #define RECOB_GetName        5  /* (obsolete name)
  113. #define RECOB_SubType        5  /* means DMR_Check() returns d0=string (& NOT d0=TRUE/FALSE) */
  114. #define RECOB_Private        6
  115. #define RECOB_DupString        7  /* used with GetName flag: means the string is ALLOCATED by the recognizer */
  116. #define RECOB_PattPriority    8
  117.  
  118. #define RECOF_Internal        (1L<<0)
  119. #define RECOF_CheckPatt        (1L<<1)
  120. #define RECOF_CheckData        (1L<<2)
  121. #define RECOF_XPKLoad        (1L<<3)
  122. #define RECOF_Disabled        (1L<<4)
  123. #define RECOF_GetName        (1L<<5)
  124. #define RECOF_SubType        (1L<<5)
  125. #define RECOF_Private        (1L<<6)
  126. #define RECOF_DupString        (1L<<7)
  127. #define RECOF_PattPriority    (1L<<8)
  128.  
  129.  
  130. /************************************************************************
  131. *                                    *
  132. * priority definitions                            *
  133. *                                    *
  134. ************************************************************************/
  135.  
  136. #define PRI_FREQUENT         10
  137. #define PRI_SINGLE          5
  138. #define PRI_GROUPED          1
  139. #define PRI_GROUPEDSLOW         -5
  140. #define PRI_RARE        -10
  141. #define PRI_HOOKNAME        -100
  142.  
  143.  
  144. /************************************************************************
  145. *                                    *
  146. * Class bits (v2.0)                            *
  147. *                                    *
  148. ************************************************************************/
  149.  
  150. #define    DMCLASSB_UNKNOWN    0
  151. #define    DMCLASSB_GRAPHICS    1
  152. #define    DMCLASSB_ANIMATION    2
  153. #define    DMCLASSB_MUSIC        3
  154. #define    DMCLASSB_SAMPLE        4
  155. #define    DMCLASSB_PACKED        5
  156. #define    DMCLASSB_SYSTEM        6
  157. #define    DMCLASSB_MISC        7
  158. #define    DMCLASSB_LINK        8
  159. #define    DMCLASSB_ASCII        9
  160.  
  161. #define    DMCLASSF_UNKNOWN    (1L<<0)
  162. #define    DMCLASSF_GRAPHICS    (1L<<1)
  163. #define    DMCLASSF_ANIMATION    (1L<<2)
  164. #define    DMCLASSF_MUSIC        (1L<<3)
  165. #define    DMCLASSF_SAMPLE        (1L<<4)
  166. #define    DMCLASSF_PACKED        (1L<<5)
  167. #define    DMCLASSF_SYSTEM        (1L<<6)
  168. #define    DMCLASSF_MISC        (1L<<7)
  169. #define    DMCLASSF_LINK        (1L<<8)
  170. #define    DMCLASSF_ASCII        (1L<<9)
  171.  
  172. /************************************************************************
  173. *                                    *
  174. * RecoList structures                            *
  175. *                                    *
  176. * WARNING!                                *
  177. * The RecoList structure has *changed*. It must ONLY be used now with    *
  178. * dmQueryRecoListNew() and dmQueryRecoNamesNew().            *
  179. * DO NOT USE the old corresponding functions!                *
  180. * The SIZE of RecoList structure is not defined !            *
  181. *                                    *
  182. ************************************************************************/
  183.  
  184. struct RecoList {    /* access ONLY rl_NumRecos & rl_RecoList array */
  185.     ULONG    rl_OwnSize;
  186.     UWORD    rl_NumRecos;    /* number of recognizers */
  187.     APTR *    rl_RecoList;    /* array of addresses of names/recos */
  188. };
  189.  
  190. /* old recolist (for internal compatibility. NEVER USE IT ANYMORE) */
  191.  
  192. struct RecoListOld { 
  193.     UWORD    orl_NumRecos;
  194.     APTR    orl_RecoList[128];
  195.     ULONG    orl_Null;
  196. };
  197.  
  198. /************************************************************************
  199. *                                    *
  200. * DM_Handle structure                            *
  201. *                                    *
  202. * It is <<PRIVATE>> and WILL change in the future!            *
  203. * You can only access the non-private fields.                *
  204. *                                    *
  205. ************************************************************************/
  206.  
  207. struct DM_Handle {
  208.     STRPTR    dmh_String;
  209.     ULONG    dmh_Size;    /* PRIVATE */
  210.     ULONG    dmh_OwnSize;    /* PRIVATE */
  211.     STRPTR    dmh_SubType;    /* (v2.0) additional SubType string, if available. */
  212.     ULONG    dmh_SubTypeSize;/* PRIVATE */
  213. };
  214.  
  215. #endif  /* LIBRARIES_DATAMASTER_H */
  216.